package com.eden.door.component;

import java.awt.Component;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

public class ImageRenderer extends JLabel implements TableCellRenderer {

	private static final long serialVersionUID = 1L;
	public ImageRenderer(){
		super();
		this.setHorizontalAlignment(CENTER) ;
		this.setSize(40, 40) ;
	}
	
	@Override
	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
//		this.setIcon((ImageIcon) value) ;
//		this.setIcon(new ImageIcon("image/rowdel.png")) ;
		if(value!=null){
			setIcon((value instanceof Icon) ? (Icon)value : null); 
			return this;
		}
		return null;
	}

}
